import Vue from './vue'
import store from './vuex/store'
import Login from './component/login/login.vue'
import { alert } from 'vue-strap'
import jsCookie from 'js-cookie'

new Vue({
  el: 'body',
  components: {
    'vue-login': Login,
    'vue-alert-msg': alert
  },
  store,
  created() {
    // 已登录的用户自动跳转到主页
    var isLogin = jsCookie.get(SESSION_COOKIE_NAME) === '1'
    if (isLogin) {
      location.href = client.htmlPath + '/index.html'
      this.$destroy()
    }
  },
  vuex: {
    getters: {
      msg: state => state.msg
    }
  }
})
